import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.common.HttpStatus;
import com.linecorp.armeria.common.MediaType;
import com.linecorp.armeria.server.annotation.Get;
import com.linecorp.armeria.server.annotation.Optional;
import com.linecorp.armeria.server.annotation.Param;

/**
 * Created by warning5 on 17-8-3.
 */
public class AnnotationService {
    @Get("/greet5")
    public HttpResponse greet(@Param("name") String name,
                              @Param("title") @Optional("Mr.") String title) {
        // "Mr." is used by default if there is no title parameter in the request.
        return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, "Hello, %s %s!", title, name);
    }
}
